module.exports = app=>{
    // 单独分离出的路由
    const {router,controller,middleware} = app
    router.get('/api/admin',controller.admin.index.index)

    // jwt认证
    const jwt = middleware.jwtCheck(app.config.jwt);

    // 认证api
    router.get('/api/admin/validate',jwt,controller.admin.index.validate)

    router.post('/api/admin/login',controller.admin.index.login)
    router.get('/api/admin/logout',jwt,controller.admin.index.logout)
    router.post('/api/admin/register',controller.admin.index.register)
    router.get('/api/admin/unregister',jwt,controller.admin.index.unregister)
 
    // 用户api
    router.post('/api/admin/searchAll',jwt,controller.admin.user.searchAll)
    router.post('/api/admin/searchDelAll',jwt,controller.admin.user.searchDelAll)
    router.post('/api/admin/searchUseAll',jwt,controller.admin.user.searchUseAll)
    router.get('/api/admin/search',jwt,controller.admin.user.search)

}